<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center evaluate_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub evaluate_fd0_0'>
					<view class='flex flex-wrap align-center evaluate_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  evaluate_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='evaluate_fd0_0_c1'>评价</text>
					<view class='flex flex-wrap align-center evaluate_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---师傅信息flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout evaluate_flex_1">
				<view class='flex flex-wrap align-center evaluate_fd1_0'>
					<image class='evaluate_fd1_0_c0' mode="aspectFit" :src='detailsData.jiedanren_info.avatar'></image>
					<view class='flex flex-direction flex-wrap align-stretch flex-sub evaluate_fd1_0_c1'>
						<text class='evaluate_fd1_0_c1_c0'>{{detailsData.jiedanren_info.nickname}}</text>
						<view class='flex flex-wrap align-center evaluate_fd1_0_c1_c1'>
							<view class='flex flex-wrap align-center'>
								<template v-for="starNum in [1,2,3,4,5]">
									<image v-if="detailsData.jiedanren_info.fuwuxingji >= starNum" :key="starNum"
										class='evaluate_star1fd1_0_c1_c1_c0' mode="aspectFit"
										:src='STATIC_URL+"377.png"'></image>
									<image v-else :key="starNum" class='evaluate_star1fd1_0_c1_c1_c0' mode="aspectFit"
										:src='STATIC_URL+"168.png"'></image>
								</template>
							</view>
						</view>
					</view>
					<image class='evaluate_fd1_0_c2' mode="aspectFit" :src='STATIC_URL+"103.png"'
						@tap.stop="callMobile(detailsData.jiedanren_info.mobile)"></image>
				</view>
				<view class='flex flex-wrap align-center evaluate_fd1_1'>
					<text class='evaluate_fd1_1_c0'>请您为我们的服务打分</text>
				</view>
				<view class='flex flex-wrap align-center evaluate_fd1_2'>
					<text class='evaluate_fd1_2_c0'>服务评价：</text>
					<view class='flex flex-wrap align-center'>
						<template v-for="starNum in [1,2,3,4,5]">
							<image @click="evaluate_star = starNum" v-if="evaluate_star >= starNum" :key="starNum"
								class='evaluate_star1fd1_2_c1' mode="aspectFit" :src='STATIC_URL+"105.png"'></image>
							<image @click="evaluate_star = starNum" v-else :key="starNum" class='evaluate_star1fd1_2_c1'
								mode="aspectFit" :src='STATIC_URL+"91.png"'></image>
						</template>
					</view>
				</view>
			</view>

			<!---师傅信息flex布局结束-->
			<!---售后flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout evaluate_flex_2">
				<view class='flex flex-wrap'>
					<textarea class='flex evaluate_input_fd2_0' :placeholder="'请输入您的评价…'" :maxlength="240"
						:show-num='true' placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
						v-model="evaluate_content" />
					<template>
						<view class='flex flex justify-end evaluate_numberfd2_0_c0'>
							<text class='evaluate_numberfd2_0_c0_c0'>{{evaluate_content.length}}</text>
							<text class='evaluate_numberfd2_0_c0_c0'>/</text>
							<text class='evaluate_numberfd2_0_c0_c0'>240</text>
						</view>
					</template>
				</view>
				<view class='flex flex-wrap align-center'>
					<text class='evaluate_fd2_1_c0'>添加照片</text>
					<text class='evaluate_fd2_1_c1'>最多可上传9张</text>
				</view>
				<benben-images-upload ref="benbenImagesUploadfd2_2" :img-list.sync="evaluate_picture_list"
					:img-ids.sync="evaluate_picture" :maxlength="9">
					<template #content="{ num, maxlength, isShow, imgList }">
						<view class="flex flex-wrap align-start flex evaluate_fd2_2">

							<view v-for="(image, index) in imgList" :key="index"
								class='flex position-relative evaluate_fd2_20'>
								<text class='fu-iconfont2 position-absolute evaluate_fd2_200'
									@tap.stop="$refs.benbenImagesUploadfd2_2.delImage(index)">&#xE8E7;</text>
								<image class='evaluate_fd2_201'
									@tap.stop="$refs.benbenImagesUploadfd2_2.previewImage(index)" mode="aspectFill"
									:src='image'></image>
							</view>
							<image class='evaluate_fd2_21' @tap.stop="$refs.benbenImagesUploadfd2_2.manyChooseImage()"
								v-if="isShow" mode="aspectFit"
								:src='STATIC_URL+"158.png"'></image>
						</view>
					</template>
				</benben-images-upload>
				<view class='flex flex-wrap align-center evaluate_fd2_3'>
					<benben-flex-switch-new class-name='flex flex' v-model="select" :disabled='false'>
						<template v-slot:checked>

							<view class='flex flex position-relative align-center'>
								<image class='evaluate_checkfd2_3_c0_c0_c0' mode="aspectFit"
									:src='STATIC_URL+"133.png"'></image>
							</view>

						</template>
						<template v-slot:unchecked>

							<view class='flex flex position-relative justify-end align-center'>
								<image class='evaluate_checkfd2_3_c0_c0_c0' mode="aspectFit"
									:src='STATIC_URL+"150.png"'></image>
							</view>

						</template>
					</benben-flex-switch-new>
					<text class='evaluate_fd2_3_c1'>匿名评价</text>
				</view>
			</view>

			<!---售后flex布局结束-->
			<view class="flex flex-direction flex-wrap align-center benben-position-layout flex evaluate_flex_3">
				<button class='evaluate_fd3_0' @tap.stop="postEvaluateFunc()">发布</button>

			</view>
			<view :style="{height: '148rpx'}"></view>


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"select": false,
				"detailsData": {
					"aid": "",
					"order_sn": "",
					"order_status": "",
					"retainer": "",
					"two_money": "",
					"door_time": "",
					"serviceproject_tupian": [],
					"serviceproject_biaoti": "",
					"serviceproject_aid": "",
					"user_nickname": "",
					"user_mobile": "",
					"notes": "",
					"pingtaiyouhuiquanid": "",
					"tupian": [],
					"coupon_money": "",
					"discount_money": "",
					"jiedanren": "",
					"create_time": "",
					"master_tel": "",
					"fuwuxinxi": "",
					"fuwuzhaopian": [],
					"order_status_name": "",
					"jiedanren_info": {
						"shifudaodashijian": "",
						"nickname": "",
						"avatar": "",
						"mobile": "",
						"fuwuxingji": "",
						"departure_time": ""
					},
					"address_info": {
						"aid": "",
						"create_time": "",
						"address": "",
						"contacts": "",
						"telephone": "",
						"lng": "",
						"lat": ""
					},
					"over_photo": [],
					"over_notes": "",
					"countdown": "",
					"payable_money": "",
					"peijian": [],
					"completion_time": "",
					"refund": [],
					"discount_money2": "",
					"subtotal": "",
					"total_amount": "",
					"serviceproject_photo": "",
					"discount_amount": "",
					"arriv_time": "",
					"service_info": "",
					"toll_amount": "",
					"user_id": "",
					"invoice": "",
					"deposit_amount": {
						"aid": "",
						"pay_order_sn": "",
						"pay_money": "",
						"pay_sn": "",
						"pay_way": "",
						"pay_status": "",
						"order_type": "",
						"pay_time": "",
						"zhifufangshi_name": "",
						"zhifuzhuangtai_name": "",
						"dingdanleixing_name": ""
					},
					"two_amount": {
						"aid": "",
						"pay_order_sn": "",
						"pay_money": "",
						"pay_sn": "",
						"pay_way": "",
						"pay_status": "",
						"order_type": "",
						"pay_time": "",
						"zhifufangshi_name": "",
						"zhifuzhuangtai_name": "",
						"dingdanleixing_name": ""
					}
				},
				"evaluate_star": "5",
				"evaluate_content": "",
				"evaluate_picture_list": [],
				"evaluate_picture": "",
				"id": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			/**
			 * @returns 
			 * Android       安卓
			 * IOS       苹果
			 * Web       H5 或 pc
			 * Wechat       微信小程序
			 * Alipay       支付宝小程序
			 * Baidu       百度小程序
			 * ByteBounce       抖音小程序
			 * 360       360小程序
			 * FastApp       快应用
			 */
			appSystemIdentification() {
				return this.$store.state.appSystemIdentification
			}
		},
		watch: {},
		onLoad(options) {
			let {
				id
			} = options
			if (id !== undefined) this.id = id
			this.getDetailsFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取师傅信息
			async getDetailsFunc() {
				//请求方法
				//数据验证

				let datadetailsData = await this.$api.get(global.apiUrls.post63a0176598251, {
					aid: this.id
				});

				if (datadetailsData.data.code != 1) {
					this.$message.info(datadetailsData.data.msg);
					return
				}
				let infodetailsData = datadetailsData.data;
				this.detailsData = infodetailsData.data

			},
			//提交评价
			async postEvaluateFunc() {
				//请求方法
				//数据验证

				let data639462ba6048b = await this.$api.dbPost(global.apiUrls.post639462ba6048b, {
					evaluate_star: this.evaluate_star,
					evaluate_content: this.evaluate_content,
					evaluate_picture: this.evaluate_picture,
					serviceorder_id: this.id,
					anonymous: this.select
				});
				if (!data639462ba6048b) return
				if (data639462ba6048b.data.code != 1) {
					this.$message.info(data639462ba6048b.data.msg);
					return
				}



				this.$urouter.navigateBack(1);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.evaluate_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.evaluate_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.evaluate_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.evaluate_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.evaluate_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.evaluate_flex_1 {
		background: #fff;
		background-size: 100% auto !important;
	}

	.evaluate_star1fd1_2_c1 {
		height: 42rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
		width: 42rpx;
	}

	.evaluate_star1fd1_2_c1 {
		width: 42rpx;
		height: 42rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.evaluate_fd1_2_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 400;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.evaluate_fd1_2 {
		padding: 50rpx 32rpx 50rpx 32rpx;
	}

	.evaluate_fd1_1_c0 {
		color: #E60036;
		font-size: 24rpx;
		font-weight: 500;
	}

	.evaluate_fd1_1 {
		background: rgba(230, 0, 54, 0.06);
		padding: 24rpx 0rpx 24rpx 32rpx;
	}

	.evaluate_fd1_0_c2 {
		width: 60rpx;
		height: 60rpx;
	}

	.evaluate_star1fd1_0_c1_c1_c0 {
		height: 19rpx;
		margin: 0rpx 3rpx 0rpx 3rpx;
		width: 19rpx;
	}

	.evaluate_star1fd1_0_c1_c1_c0 {
		width: 19rpx;
		height: 19rpx;
		margin: 0rpx 3rpx 0rpx 3rpx;
	}

	.evaluate_fd1_0_c1_c1 {
		margin: 20rpx 0rpx 0rpx 0rpx;
	}

	.evaluate_fd1_0_c1_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.evaluate_fd1_0_c1 {
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.evaluate_fd1_0_c0 {
		width: 108rpx;
		height: 108rpx;
		border-radius: 54rpx 54rpx 54rpx 54rpx;
	}

	.evaluate_fd1_0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 32rpx 32rpx 32rpx;
	}

	.evaluate_flex_2 {
		background: #fff;
		margin: 20rpx 0rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		padding: 32rpx 32rpx 0rpx 32rpx;
	}

	.evaluate_fd2_3_c1 {
		color: #999999;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 36rpx;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.evaluate_checkfd2_3_c0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
	}

	.evaluate_fd2_3 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.evaluate_fd2_21 {
		width: 180rpx;
		height: 180rpx;
		margin: 0rpx 24rpx 24rpx 0rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.evaluate_fd2_201 {
		width: 180rpx;
		height: 180rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.evaluate_fd2_200 {
		top: 0rpx;
		right: 0rpx;
		z-index: 10;
		color: #ff5536;
	}

	.evaluate_fd2_20 {
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.evaluate_fd2_2 {
		margin: 20rpx 0rpx 8rpx 0rpx;
	}

	.evaluate_fd2_1_c1 {
		color: rgba(191, 191, 191, 1);
		font-weight: 400;
		line-height: 42rpx;
		width: 158rpx;
		height: 33rpx;
		font-size: 24rpx;
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.evaluate_fd2_1_c0 {
		width: 128rpx;
		height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		line-height: 42rpx;
	}

	.evaluate_numberfd2_0_c0_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(191, 191, 191, 1);
	}

	.evaluate_numberfd2_0_c0 {
		width: 100%;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.evaluate_input_fd2_0 {
		width: 100%;
		height: 200rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		white-space: pre-wrap;
	}

	.evaluate_flex_3 {
		width: 750rpx;
		height: 148rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.evaluate_fd3_0 {
		background: var(--benbenbgColor2);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		width: 686rpx;
		height: 88rpx;
		line-height: 88rpx;
		margin: 20rpx 0rpx 0rpx 0rpx;
	}
</style>